package com.cpit.platform.dto;

import com.cpit.platform.common.excel.annotation.ExcelField;

import javax.persistence.*;
import java.util.Date;

/**
 * @author Hulunliang
 * @since 2017/11/21.
 */
@Entity
@Table(uniqueConstraints = {@UniqueConstraint(columnNames = {"company", "department"})})
public class TestEntity extends BaseEntity {
    public static final String  ENTITY_DISPLAY_NAME = "测试信息";

    @ExcelField(title="姓名", align=2, sort = 1)
    @Column(nullable = false, length = 10, unique = true)
    private String name;

    @ExcelField(title="手机号", align=2, sort = 2)
    @Column(nullable = false, length = 11, unique = true)
    private String mobile;

    @ExcelField(title="生日", align=2, sort = 3)
    @Column(nullable = false)
    private Date birth;

    @ExcelField(title="薪水", align=2, sort = 4)
    @Column(nullable = false)
    private Double salary;

    @ExcelField(title="所属公司", align=2, sort = 5)
    @Column(nullable = false, length = 50)
    private String company;

    @ExcelField(title="所属部门", align=2, sort = 6)
    @Column(nullable = false, length = 30)
    private String department;

    public String getName() {
        return name;
    }

    public void setName(String name) {
        this.name = name;
    }

    public String getMobile() {
        return mobile;
    }

    public void setMobile(String mobile) {
        this.mobile = mobile;
    }

    public Date getBirth() {
        return birth;
    }

    public void setBirth(Date birth) {
        this.birth = birth;
    }

    public Double getSalary() {
        return salary;
    }

    public void setSalary(Double salary) {
        this.salary = salary;
    }

    public String getCompany() {
        return company;
    }

    public void setCompany(String company) {
        this.company = company;
    }

    public String getDepartment() {
        return department;
    }

    public void setDepartment(String department) {
        this.department = department;
    }

    @Override
    public String toString() {
        return "TestEntity{" +
                "name='" + name + '\'' +
                ", mobile='" + mobile + '\'' +
                ", birth=" + birth +
                ", salary=" + salary +
                ", company='" + company + '\'' +
                ", department='" + department + '\'' +
                "} " + super.toString();
    }
}
